import request from '@/utils/request'

/** *
 * 列表
 */
function list() {
  return request({
    url: '/sapi/sys/department/list',
    method: 'post'
  })
}

/** *
 * 添加
 * @param data
 */
function add(data) {
  return request({
    url: '/sapi/sys/department/add',
    method: 'post',
    data: data
  })
}

/** **
 * 权限
 * @param data
 */
function edit(data) {
  return request({
    url: '/sapi/sys/department/edit',
    method: 'post',
    data: data
  })
}

/** *
 * 删除
 * @param id
 */
function remove(id) {
  const postData = {}
  postData.id = id
  return request({
    url: '/sapi/sys/department/delete',
    method: 'post',
    data: postData
  })
}

export default {
  list,
  add,
  edit,
  remove
}
